package com.zz.framework.core.entity

import com.bumptech.glide.load.model.GlideUrl
import com.bumptech.glide.load.model.LazyHeaders


/**
 * Copyright © 2022 stariverpan All rights reserved.
 * 2022/5/5 17:10.
 *
 * @version: V1.0
 */
class SelfGlideUrl(url: String?, cacheKey: String?) : GlideUrl(url) {
    private var mCacheKey: String? = null
    override fun getCacheKey(): String {
        // 这里根据需求构建缓存key
        return mCacheKey ?: super.getCacheKey()
    }
    init {
        mCacheKey = cacheKey
    }
}
class SelfGlideUrlWithHeader(url: String?, cacheKey: String?) : GlideUrl(url,LazyHeaders.Builder()
    .addHeader("Referer", "https://share.stariverpan.com")
    .build()) {
    private var mCacheKey: String? = null
    override fun getCacheKey(): String {
        // 这里根据需求构建缓存key
        return mCacheKey ?: super.getCacheKey()
    }
    init {
        mCacheKey = cacheKey
    }
}


